10.5 AT^SISO Internet Service OpenThe AT^SISO write command starts the Internet session configured by the service profile. All further steps needed to control the session depend on whether you are using URC mode or polling mode. The AT^SISO read command returns the current status of all services.
URC mode:
If the service opens successfully, the URCs "^SISW" and "^SISR" will trigger the action to follow, either writing data with AT^SISW or reading data with AT^SISR. To terminate an upload data stream set the <eodFlag> within the last AT^SISW command. If the URCs notify that a data transfer has been successful ("^SISR: x, 2" or "^SISW: x, 2"), the service can be closed with AT^SISC. If a special event occurs, e.g. an error or a warning, after opening or while using a service then the URC type "^SIS" will be delivered.
Polling mode:
After opening the service, all progress information needed to control the session shall be explicitly requested by the host application. The particular sequence of AT commands varies depending on the service used. The following list summarizes, by way of an example, the steps normally involved in managing an upload or download job.
- Enter AT^SISW, specify <reqWriteLength>, e.g. AT^SISW=9,20. Check resulting response for <cnfWriteLength>. Optionally, check error with AT^SISE, e.g. AT^SISE=9. If necessary, repeat the sequence several times.
- Enter last AT^SISW command and enable <eodFlag>, e.g. AT^SISW=9,0,1.
If Socket service: Query available data with AT^SISR, e.g. AT^SISR=9,1430.
- Check service state with AT^SISI, e.g. AT^SISI=9, if necessary several times until <srvState>=6 ("Down").
- Check error with AT^SISE, e.g. AT^SISE=9.
- Close service with AT^SISC, e.g. AT^SISC=9.
- Enter AT^SISR, specify <reqReadLength>, e.g. AT^SISR=9,1000. Check resulting response for <cnfReadLength>. If necessary, repeat the sequence several times until <cnfReadLength>= -2 (end of data) or ERROR.
- Check error with AT^SISE, e.g. AT^SISE=9.
- Close service with AT^SISC, e.g. AT^SISC=9.
- Recommended: Set AT+CMEE=2 to enable extended error text.
- Enter AT^SISR or AT^SISW, specifying <reqReadLength> or <reqWriteLength>, e.g. AT^SISR=9,20 or AT^SISW=9,20. Check resulting response for <cnfReadLength> or <cnfWriteLength>. If necessary, repeat the sequence several times.
- Check error with AT^SISE, e.g. AT^SISE=9.
- If write action: Enter last AT^SISW command and enable <eodFlag>, e.g. AT^SISW=9,0,1.
If Socket service: Query available data with AT^SISR, e.g. AT^SISR=9,1430.
-
^SISO: <srvProfileId>, <srvParmTag>value "srvType" [, <srvState>, <socketState>, <rxCount>, <txCount>, <locAddr>, <remAddr>] [^SISO: ...]
+CME ERROR: <err>
<srvProfileId>(num)<srvProfileId> 0 ... 9 specified with AT^SISS.
<srvState>(num)Internet service state.
Please note, that the state of an Internet service may influence the state of the serial DCD line. For details see description of value 2 for parameter <value> of command AT&C.Allocated
Service profile resources are allocated, i.e. at least the service type has been set (parameter <srvParmTag>, value "srvType" of AT^SISS). The service is not opened, but ready for configuration.Connecting
State after opening a service with AT^SISO where the connection is being established.
If connection setup is successful the service proceeds to the state "4" (Up) and one of the URCs "^SISW" and "^SISR" may follow. If connection setup is not successful, the "^SIS" URC may appear and the service enters <srvState> 6 (Down).
In the case of FTP, <srvState>=3 means that the command channel is being established.
If the service profile is configured as Socket listener, then the listener always stays at <srvState>=3 and <socketState>=3 (LISTENER), while the <srvState> and <socketState> of the dynamically assigned service profile may change. See examples in Section 10.5.1.Up
The service performs its purpose. The data transfer process is the major function at this state.
FTP: Data channel is up.
SMTP: The SMTP service will not enter <srvState>=4 until the host has written the first data packet with AT^SISW.Down
This state is entered if
- the service has successfully finished its session (see note on Socket),
- the remote peer has reset the connection or
- the IP connection has been closed because of an error (see note below on service or network errors).
If a service in this state be sure to close it with AT^SISC before reopening it.
<socketState>(num)
<rxCount>(num)
<txCount>(num)
<locAddr>(str)Recently used local IP address in dotted-four-byte format and TCP port, separated by colon, e.g. "192.60.10.10:80".
<remAddr>(str)
•
• If a service or network error occurs during an IP session and the "^SIS" URC or the AT^SISE command display an error message, the service enters <srvState>=5 and then 6, i.e. the IP connection is closed. In this case, the service still allows reading the data stored in the buffer, but writing data is denied. After reading, close the service and open it again.
• As in polling mode no error URCs are available you are advised to integrate the commands AT^SISI and AT^SISE into the command sequences for upload and download jobs. So, the AT^SISO command may be followed by AT^SISI to check that the service has entered the <srvState>=4 before sending AT^SISR or AT^SISW. This helps you to detect errors even though the "^SIS" URCs are disabled. A typical example is that the service fails to be opened because the service profile contains a wrong destination address. In such a case, after opening with AT^SISO and OK response, the service quickly enters the states <srvState>=2, 4 and 6, with an error being returned no earlier than after sending the first AT^SISR or AT^SISW command. In URC mode, an error URC, such as "Host not found" would be received in this situation, but in polling mode the only way to detect the state is using AT^SISI or, alternatively, AT^SISO.
• If the user rapidly closes and opens TCP/IP connections based on the embedded TCP/IP stack the service may display the error "No buffer space available", meaning that all TCP/IP socket resources are exhausted. In the worst case, opening further TCP/IP connections is locked for up to 60 seconds.
• The Socket Listener may not work properly if the service is re-opened shortly after having closed the Socket Listener. To ensure that the service works correctly the host is required to wait at least two minutes before re-opening a Listener.
|